package com.oasistudio.ads.expert;

import java.util.ArrayList;
import java.util.List;

import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.TextView;

import com.mobclick.android.MobclickAgent;
import com.oasistudio.ads.expert.other.AdwoFullScreen;
import com.oasistudio.ads.expert.other.OtherAdType;

/**各个联盟的横幅以外广告形式荟萃。*/
public class OthersGallery extends ListActivity {
	public void onCreate(Bundle icicle){ 
        super.onCreate(icicle); 
        //setTheme(android.R.style.Theme_Dark); 
        setContentView(R.layout.others_gallery); 
        
        TextView title = (TextView)findViewById(R.id.others_gallery_title);
        title.setText("其它形式广告");
        
        List<OtherAdType> items = fillArray();        
        ArrayAdapter<OtherAdType> adapter = new ArrayAdapter<OtherAdType>(this, R.layout.others_gallery_list_row, R.id.others_gallery_list_row_item1, items); 
               
        this.setListAdapter(adapter); 
    } 
    private List<OtherAdType> fillArray() { 
        List<OtherAdType> items = new ArrayList<OtherAdType>(); 
        items.add(new OtherAdType<AdwoFullScreen>("adwo.com", "点击查看全屏广告（显示有问题）", AdwoFullScreen.class));
        items.add(new OtherAdType("appmedia.cn", "开发者文档中无相关内容", null));
        items.add(new OtherAdType("casee.cn", "开发者文档中无相关内容", null));
        items.add(new OtherAdType("domob.cn", "开发者文档中无相关内容", null));
        items.add(new OtherAdType("admob.com", "开发者文档中无相关内容", null));
        items.add(new OtherAdType("smartmad.com", "有全屏广告、炫动广告、视频广告等形式，但不受开发者控制", null));
        items.add(new OtherAdType("taobao.com", "开发者文档中无相关内容", null));
        items.add(new OtherAdType("vpon.com", "开发者文档中无相关内容", null));
        items.add(new OtherAdType("wiyun.com", "开发者文档中无相关内容,可以创建文字、横幅、全屏三种广告位，根据广告位ID请求相应广告。", null));
        items.add(new OtherAdType("youmi.com", "开发者文档中无相关内容，有几份墙和插播业务，需要单独集成SDK。", null));
        items.add(new OtherAdType("iaiwan.com", "开发者文档中无相关内容。", null));
        return items; 
    } 
   
    @Override 
    protected void onListItemClick(ListView l, View v, int position, long id) { 
    	System.out.println("OthersGallery.onListItemClick() listView = "+l);
    	System.out.println("OthersGallery.onListItemClick() view = "+v);
    	System.out.println("OthersGallery.onListItemClick() position = "+position);
    	System.out.println("OthersGallery.onListItemClick() id = "+id);
    	System.out.println("OthersGallery.onListItemClick() listView.getSelectedItem() = "+l.getSelectedItem());
    	System.out.println("OthersGallery.onListItemClick() v.findViewById(R.id.others_gallery_list_row_item1)="+v.findViewById(R.id.others_gallery_list_row_item1));
    	Intent intent = new Intent(this, AdwoFullScreen.class);
    	this.startActivity(intent);
    } 
    
	/************************** umeng.com start *************************/
	public void onResume() { 
		super.onResume();
		MobclickAgent.onResume(this);
	}
	public void onPause() { 
		super.onPause();
		MobclickAgent.onPause(this);
	}
	/************************** umeng.com end *************************/
}